<?php
/**
 * Created by PhpStorm.
 * User: xiong <1099446868@qq.com>
 * DateTime: 2018/11/12
 * TIME: 21:26
 */

//Route::get('[:source]', 'index');  //这里跟下面的移动端有冲突
Route::get('/', 'index');
Route::get('/gettable/:id', 'api/getTable');
Route::get('api/rank/:rank/:page', 'index/api/getrank');
Route::get('api/baidu/:page', 'index/api/baidu');
Route::get('api/baidu2/:page', 'index/api/baidu2');
Route::get('api/baidu3/:page', 'index/api/baidu3');
Route::get('api/getnewid', 'index/api/getnewid');
Route::get('api/getcon/:page', 'index/api/spider_con');
Route::get('api/send/:page', 'index/api/send');
Route::get('api/update/:page', 'index/api/sendUpdate');

//Route::get('m', 'index/Mobile/index');
Route::domain('m', function () { //手机端首页
    // 动态注册域名的路由规则
    Route::rule('/[:id]', 'mobile/index/index');
    Route::rule('search/:searchname', 'mobile/book/search');
    Route::rule('find/:bookname', 'mobile/book/find');
    //Route::rule(':user', 'index/user/info');
})->bind('mobile');

//变量规则
Route::pattern([
    'id'   => '\d+',
    'name' => '\w+',
    'tag' => '\w+',
    'page' => '\d+',
    //'source'=>'\d+'
]);